package org.example.springboot01.pojo;

public class Result<T> {
    private int code;
    private static String msg;
    private T data;

    public int getCode() {
        return code;
    }

    public void setCode(int code) {
        this.code = code;
    }

    public String getMsg() {
        return msg;
    }

    public void setMsg(String msg) {
        this.msg = msg;
    }

    public T getData() {
        return data;
    }

    public void setData(T data) {
        this.data = data;
    }

    public Result() {
    }

    public Result(int code, String msg, T data) {
        this.code = code;
        this.msg = msg;
        this.data = data;
    }
   public static <T>Result<T>success(T data){
       return new Result<T>(0,"success",data);
   }
   public static Result success( ){
      return new Result(0,"登录成功",null);
   }
   public static Result error(String msg){
      return new Result(1,msg,null);
   }
}
